/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.inathitunzana.principles.ocpcomply.Impl;

//import com.zuma.tp3assignment2.ocpviolate.Impl.*;
import com.inathitunzana.principles.ocpcomply.Validator;
import com.inathitunzana.principles.ocpcomply.Loanrequestvalidator;
/**
 *
 * @author Student
 */
public class LoanrequestvalidatorImpl implements Loanrequestvalidator{

    double accBalance;
    int tPeriod;

    public void SetBalance(double balance)
    {
        accBalance = balance;
    }

    public void SetPeriod(int period)
    {
        tPeriod = period;
    }
     // WHAT IF in future, say we want to get approval for a BUSINESS LOAN
     // OF a client with at least 100 000, we have to alter the IF Statement
     // thereby violating OCP
    public String GetApproval(Validator validator)
    {
        if(validator.IsValid(accBalance))
            return "Loan Approved";
        else
            return "Insufficient Balance";
    }


}
